<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<select name="" id="month">
    <option value="1">1月</option>
    <option value="2">2月</option>
    <option value="3">3月</option>
    <option value="4">4月</option>
    <option value="5">5月</option>
    <option value="6">6月</option>
    <option value="7">7月</option>
    <option value="8">8月</option>
    <option value="9">9月</option>
    <option value="10">10月</option>
    <option value="11">11月</option>
    <option value="12">12月</option>
</select>
<select name="" id="cw">
    <option> 头等舱</option>
    <option> 经济舱</option>
</select>
<br>
<button id="btn"> 计算价格</button>
<script>
var monthSelect = document.getElementById("month");
var cwSelect = document.getElementById("cw");
var btn = document.getElementById("btn");
btn.onclick = function (){
    var month = monthSelect.value;
    var cw = cwSelect.value;
    
    //计算出来淡季或者旺季
    var offSeason = "淡季";
    if(month >=4 && month <= 10){
        offSeason = "旺季";
    }
    // 计算出来他的折扣
    var discount = 1;
    if(offSeason == "淡季"){
        if(cw == "经济舱"){
            discount = 0.3;
        }else{
            discount = 0.6;
        }
    }else{
        if(cw == "经济舱"){
            discount = .75;
        }else{
            discount = 0.9;
        }
    }
    
    //打过折扣之后的金额
    var money = 4000 * discount;
    alert("你出行的月份是:" + month
        + "\n 你的仓位是:" + cw
        + "\n 总金额:" + money + "元"
    )
}
</script>
</body>

</html>